package com.zjq.smartdevice.mapper;

import com.zjq.smartdevice.pojo.SysScene;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

/**
 * @User zhangjiaqi
 * @Project project
 * @Package com.zjq.smartdevice.mapper
 * @Date 2022/3/22 14:54
 */
public interface SysSceneMapper {

    @Insert("insert into sys_scene(scene_name,create_by,create_time) values (#{sceneName},#{createBy},#{createTime})")
    void addSysScene(SysScene sysScene);

    @Select("select * from sys_scene where create_by=#{userId} and scene_name=#{scenceName}")
    SysScene findByUserAndName(@Param("userId") Long userId, @Param("scenceName") String scenceName);

    @Update("update sys_scene set status=#{status} where scene_id =#{sceneId}")
    int updateStatus(@Param("sceneId") Long scene_id,@Param("status") Long status);

    @Select("select * from sys_scene where scene_id=#{id}")
    SysScene findById(Long id);

}


